package cn.net.yato.picture.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @ClassName Role
 * @Description 角色表
 * @Author yato
 * @Date 2020/2/17 12:54
 * @Version 1.0
 */
@Data
@TableName(value = "role")
public class Role implements Serializable {
    /**
     * 自增id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private long id;
    /**
     *角色id 唯一
     */
    @TableField(value = "role_id")
    private String roleId;
    /**
     * 角色名 唯一
     */
    @TableField(value = "name")
    private String name;
    /**
     * 角色标识
     */
    @TableField(value = "perms")
    private String perms;
    /**
     * 角色描述
     */
    @TableField(value = "description")
    private String description;
    /**
     * 角色状态
     * 1:使用中
     * 0:停用
     */
    @TableField(value = "status")
    private int status;
    /**
     * 角色创建日期
     */
    @TableField(value = "create_time")
    private Date createDate;
    /**
     * 角色修改日期
     */
    @TableField(value = "update_time")
    private Date updateDate;
    /**
     * 权限集合
     */
    @TableField(exist = false)
    private List<Permission> permissions = new ArrayList<>();

    public Role(){
    }

    public Role(long id, String roleId, String name, String perms, String description, int status, Date createDate, Date updateDate, List<Permission> permissions) {
        this.id = id;
        this.roleId = roleId;
        this.name = name;
        this.perms = perms;
        this.description = description;
        this.status = status;
        this.createDate = createDate;
        this.updateDate = updateDate;
        this.permissions = permissions;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPerms() {
        return perms;
    }

    public void setPerms(String perms) {
        this.perms = perms;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public List<Permission> getPermissions() {
        return permissions;
    }

    public void setPermissions(List<Permission> permissions) {
        this.permissions = permissions;
    }
}
